package com.study.zzedu.ui.appointexam;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;

import com.study.zzedu.R;
import com.study.zzedu.adapter.AppointExamAdapter;
import com.study.zzedu.adapter.YiDongAdapter;
import com.study.zzedu.base.BaseMvpActivity;
import com.study.zzedu.base.BaseView;
import com.study.zzedu.entity.AppointModel;
import com.study.zzedu.entity.YiDongModel;
import com.study.zzedu.ui.yidonginfo.YiDongInfoActivity;
import com.study.zzedu.utils.ToastUtil;
import com.study.zzedu.widget.SpacesItemDecoration;

import java.util.ArrayList;
import java.util.List;

//预约考试页面
public class AppointExamActivity extends BaseMvpActivity<AppointExamContract.IView, AppointExamPresenter> implements AppointExamContract.IView, View.OnClickListener {

    List<AppointModel> yList = new ArrayList<>();
    @Override
    protected int getLayoutID() {
        return R.layout.activity_apponintment_exam_info;
    }

    @Override
    protected AppointExamPresenter createPresenter() {
        return new AppointExamPresenter();
    }


    @Override
    protected AppointExamContract.IView createView() {
        return this;
    }

    private RecyclerView rView;
    private RelativeLayout btnBack;
    @Override
    protected void initView() {
        btnBack = findViewById(R.id.rl_back);
        rView = (RecyclerView)findViewById(R.id.rv_app_exam);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        rView.setLayoutManager(layoutManager);

        AppointExamAdapter adapter = new AppointExamAdapter(yList);
        //rView.addItemDecoration(new SpacesItemDecoration(30));
        rView.setAdapter(adapter);
    }

    @Override
    protected void initData() {
        //getPresenter().getYiDongInfoList(AppointExamActivity.this);
    }

    @Override
    protected void initListener() {
        btnBack.setOnClickListener(this);
    }

    @Override
    public void getData(String data) {
        findViewById(R.id.rl_default_appoint).setVisibility(View.GONE);
        //AppointExamActivity.this.finish();
    }

    @Override
    public void showError(String error) {
        if (null != error && !TextUtils.isEmpty(error)) {
            ToastUtil.showShortToast(error);
        }
    }

    @Override
    public void onClick(View v) {
        {
            finish();
        }
    }

    @Override
    public void getOpprationData(String name) {

    }

    @Override
    public void getModifyData(String name) {

    }
}